package org.gruposp2p.proyectokarma.gwt.client.domain;

import static org.gruposp2p.proyectokarma.gwt.client.json.JSONConstants.PEER_ACCOUNT_EXPIRED;
import static org.gruposp2p.proyectokarma.gwt.client.json.JSONConstants.PEER_ACCOUNT_LOCKED;
import static org.gruposp2p.proyectokarma.gwt.client.json.JSONConstants.PEER_ENABLED;
import static org.gruposp2p.proyectokarma.gwt.client.json.JSONConstants.PEER_PASSWORD_EXPIRED;

import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import com.google.gwt.json.client.JSONBoolean;

public class Peer  implements java.io.Serializable {

     private Long id;
     private String name;
     private String username;
     private String phone;
     private String url;
     private String email;
     private Date dateAdded = new Date();
     private Date lastEntryDate;
     private String password;
     //private byte[] image;
     private Set<Vote> votes = new HashSet<Vote>(0);
     private Set<Document> documents = new HashSet<Document>(0);
     private Set<KarmaParameter> karmaParameters = new HashSet<KarmaParameter>(0);
     private Set<Address> addresses = new HashSet<Address>(0);
     private Set<Role> roles = new HashSet<Role>(0);
     
     private Boolean accountExpired;
     private Boolean accountLocked;
     private Boolean passwordExpired;
     private Boolean enabled;

     public Peer() { }

     public Peer(Long id, String name, String email,
            Date dateAdded, Date lastEntryDate, String username) {
         this.id = id;
         this.username = username;
         this.name = name;
         this.email = email;
         this.dateAdded = dateAdded;
         this.lastEntryDate = lastEntryDate;
     }
     
     public Peer(String name, String email,
             String password, String username) {
          this.username = username;
          this.name = name;
          this.email = email;
          this.password = password;
      }
     
     public Peer(String name, String email,
             String password, String username, boolean accountExpired,
             boolean accountLocked,boolean passwordExpired,boolean enabled) {
          this.username = username;
          this.name = name;
          this.email = email;
          this.password = password;
      }
   
     public Long getId() {
         return this.id;
     }
    
     public void setId(Long id) {
         this.id = id;
     }
    
     public String getUsername() {
         return this.username;
     }
    
     public void setUsername(String username) {
        this.username = username;
     }
    
     public String getPhone() {
         return this.phone;
     }
    
     public void setPhone(String phone) {
         this.phone = phone;
     }
    
     public String getUrl() {
         return this.url;
     }
    
     public void setUrl(String url) {
         this.url = url;
     }
    
     public String getEmail() {
         return this.email;
     }

     public void setEmail(String email) {
         this.email = email;
     }

     public Date getDateAdded() {
         return this.dateAdded;
     }
    
     public void setDateAdded(Date dateAdded) {
         this.dateAdded = dateAdded;
     }

     public Date getLastEntryDate() {
         return this.lastEntryDate;
     }

     public void setLastEntryDate(Date lastEntryDate) {
         this.lastEntryDate = lastEntryDate;
     }
    
     public String getPassword() {
        return this.password;
     }
    
     public void setPassword(String password) {
         this.password = password;
     }

     public Set getVotes() {
         return this.votes;
     }
    
     public void setVotes(Set votes) {
         this.votes = votes;
     }

    public Set getDocuments() {
        return this.documents;
    }
    
    public void setDocuments(Set documents) {
        this.documents = documents;
    }

    public Set getKarmaParameters() {
        return this.karmaParameters;
    }
    
    public void setPeerKarmaParameters(Set karmaParameters) {
        this.karmaParameters = karmaParameters;
    }

    public Set getAddresses() {
        return this.addresses;
    }
    
    public void setPeerAddresses(Set addresses) {
        this.addresses = addresses;
    }

	public void setRoles(Set<Role> roles) {
		this.roles = roles;
	}

	public Set<Role> getPeerRole() {
		return roles;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setAccountExpired(Boolean accountExpired) {
		this.accountExpired = accountExpired;
	}

	public Boolean isAccountExpired() {
		return accountExpired;
	}

	public void setAccountLocked(Boolean accountLocked) {
		this.accountLocked = accountLocked;
	}

	public Boolean isAccountLocked() {
		return accountLocked;
	}

	public void setPasswordExpired(Boolean passwordExpired) {
		this.passwordExpired = passwordExpired;
	}

	public Boolean isPasswordExpired() {
		return passwordExpired;
	}

	public void setEnabled(Boolean enabled) {
		this.enabled = enabled;
	}

	public Boolean isEnabled() {
		return enabled;
	}
	
}


